
package objetUtils;

import java.util.Comparator;

/**
 * Classe de comparator
 */
public final class ComparatorUtils
{
    
    public static final Comparator<Sommet> SOMMET_DEGRE_COMPARATOR = new Comparator<Sommet>()
    {
        public int compare(Sommet sommetA, Sommet sommetB)
        {
            int degre1 = sommetA.getDegreSommet();
            int degre2 = sommetB.getDegreSommet();
            int retour;
            if (degre1 > degre2)
            {
                retour = -1;
            }
            else if (degre1 == degre2)
            {
                retour = 0;
            }
            else
            {
                retour = 1;
            }
            return retour;
        }
    };
}
